<?php
include('login.php');
if(!$cache->cacheFile('left.php')){
	$homestock = $db->fetch_array("SELECT `listcat`,`title`,`alias`,`home_text`,`homeimg` FROM stock_post
				  WHERE status = 1 LIMIT 0 , 20");
	foreach($homestock as $hstock)
	{
		$arraystock[] = array(
							'title' => $hstock['title'],
							'home_text' => $hstock['home_text'],
							'homeimg' => $nv_Request->chuyenLinkURL($hstock['homeimg'],$global_config['img']),
							'link' => LinkPost($hstock['listcat']).$hstock['alias']
						   );
	}
	$ym = $db->fetch_array("SELECT `name` , `ym` FROM tb_admin
							WHERE `status` =1
							AND `ym` != ''");
				  
	$xtpl = new XTemplate( "themes/".$global_config['themes']."/modules/main/left.tpl");
	foreach($arraystock as $stock){
		$xtpl->assign( "CONTENT",$stock );
		$xtpl->parse( 'main.content' );
	}
	
	foreach($ym as $yahoo){
		$xtpl->assign( "YM",$yahoo );
		$xtpl->parse( 'main.ym' );
	}
	$xtpl->parse( 'main' );
	$data =$xtpl->text('main');
	$content.= $data;
	$cache->closeFile($data);// truyền dữ liệu cho cache	
}
else
	$content.=$cache->cacheFile('left.php');// đọc file cache /
?>

